﻿using Forum.Model.Entity.System;
using SqlSugar;

namespace Forum.Model.Entity
{
    /// <summary>
    /// 留言
    /// </summary>
    public class Comment
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// 留言内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 上条留言ID
        /// </summary>
        public int? ParentId { get; set; }
        /// <summary>
        /// 博客ID
        /// </summary>
        public string PostId { get; set; }
        /// <summary>
        /// 用户ID
        /// </summary>
        public string UserId { get; set; }
        /// <summary>
        /// 用户信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(UserId))]
        public SYS_USER User { get; set; }

        /// <summary>
        /// 对留言的回复
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<Comment>? Reply { get; set; }
    }
}
